#include"Comm.hpp"



class Server
{
public:
    //打开文件 -- 
    bool  OpenFifo()
    {
        _fd = Open(o_rdonly);
        if(_fd < 0)
            return false;
        
        return true;
    }

    //读文件
    int readFifo(std::string *out)
    {
        char buffer[size];
        int n = read(_fd,buffer,sizeof(buffer));
        std::cout<<n<<std::endl;
        buffer[n] = 0;
        *out = std::string(buffer);

        return n;
    }

    //关闭文件
    void CloseFifo()
    {
        Close(_fd);
    }

private:
    int _fd;
};